package com.akcome.apollo.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service;

import com.akcome.apollo.domain.VStatsUsersHour;
import com.akcome.apollo.repository.VStatsUsersHourRepository;
import com.akcome.apollo.service.VStatsUsersHourService;


/**
 * Service接口实现
 *
 * @author wn
 * @version $v: 1.0.0, $time:2017-12-26 08:49:00 Exp $
 */
@Service
public class VStatsUsersHourServiceImpl implements VStatsUsersHourService {

	private Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private VStatsUsersHourRepository vStatsUsersHourRepository;
	
	@Override
	public VStatsUsersHour save(VStatsUsersHour vStatsUsersHour){
		return vStatsUsersHourRepository.save(vStatsUsersHour);
	}
	
	@Override
	public VStatsUsersHour findOne(Long id){
		return vStatsUsersHourRepository.findOne(id);
	}
	
	@Override
	public Long sumEarnByPuidAndhourBetween(Long puid,String beginDate,String endDate){
		return vStatsUsersHourRepository.sumEarnByPuidAndhourBetween(puid, beginDate, endDate);
	}
	
	@Override
	public Long sumEarnByPuid(Long puid){
		return vStatsUsersHourRepository.sumEarnByPuid(puid);
	}
	
	@Override
	public List<VStatsUsersHour> findByPuidAndhourBetween(Long puid,String beginDate,String endDate,String coinType){
		return vStatsUsersHourRepository.findByPuidAndhourBetween(puid, beginDate, endDate, coinType);
	}
}
